<div class='admin-page'>
<% 
  var languages = [];
  for(var language in languageCache) { 
    languages.push(language);
  }
  languages.sort();
%>
  
  
<% 
  for(var i=0, len = languages.length; i < len; i++) { 
    var language = languages[i];
    if (language) {
%>
  <div id="lang-<%- language %>" class="language-wrap">
    <h3><%- language %></h3>
    <pre>
      <code>
exports.language = {
<%
      // First of all, put them into an array
      var items = [], c = 0, len;

      for(var item in languageCache[language]) {
        items.push(item);
      }

      // Sort the array
      items = items.sort();
      len = items.length;
      // Now, lets write out our object in a sorted fashion!
      items.forEach(function(key,value) {
        c++;
%>  
  <%- JSON.stringify(key) %>:<%- JSON.stringify(languageCache[language][key]) %><% if (c < len) { %>,<% } %>
<%
      });
%>  
}
      </code>
    </pre>
  </div>
<% 
    // close out the if statement
    }
  } 
%>
  <div class="language-note">
    <small>
      These are the language arrays currently in memory on this server.  If you have added translation strings but not added them to the base language file, you can copy the objects from here to update those files.  This is particularly for forms where any titles, labels or descriptions are translated dynamically.
    </small>
  </div>
</div>